import { ListItem } from './homeReducer'

export const SET_LIST = "SET_LIST";
export const ADD_LIST = 'ADD_LIST'

export interface SetList {
  type: typeof SET_LIST;
  payload: ListItem[];
}

export function setListActionCreator(payload: ListItem[]): SetList {
  return { type: SET_LIST, payload };
}


export interface AddList {
  type: typeof ADD_LIST;
  payload: ListItem;
}

export function addListActionCreator(payload: ListItem): AddList {
  return { type: ADD_LIST, payload };
}

export type HomeAction = SetList | AddList
